<template>
<div>
    <mov-banner :list="bannerList" v-if="bannerList.length"></mov-banner>
    <mov-nav></mov-nav>
    <div>
        <router-view></router-view>
    </div>
</div>
  
</template>

<script>
import MovBanner from './components/banner.vue'
import MovNav from './components/nav.vue'
import { getBanner } from "@/api/movie.js";

export default {
    data(){
        return {
           bannerList:[] 
        }

    },
 components:{
     MovBanner,
     MovNav
 },
 created(){
       this.getBannerList()

 },
 methods:{
     getBannerList(){
     getBanner().then(res=>{
         console.log(res)
    this.bannerList=res.data
     })
     }
 }
}
</script>

